<!-- Login form area -->            
<div class="loginWrapper" style="margin:-250px 0 0 -160px; clear:both;">
	<div class="loginLogo"></div>
    <div class="loginPanel" style="height:160px;">
        <div class="head"><h5 class="iUser">Select directory</h5></div>
        <form action="<?php echo url_for("select_directory/set_directory") ?>" id="valid" class="mainForm" method="POST">
            <fieldset>
                <div class="loginRow">
                    <label for="req2">Directory:</label>
                    <div class="loginInput">
                    	<select id="sl_master_directory" name="sl_master_directory">
							<option value="">
                    		--Select--
                    		</option>                    	
                    		<?php 
                    		foreach($directories as $directory){
                    			?>
                    		<option value="<?php echo $directory->getId()?>">
                    			<?php echo $directory->getName()?>
                    		</option>	
                    		<?php 
                    		}
                    		?>
                    	</select>
                    </div>
                    <div class="fix"></div>
                </div>     
                
                <div class="loginRow">
					<label for="req2"></label>
                    <div class="loginInput"> <input id="save" type="submit" value="Ok" class="basicBtn submitForm" /></div>
                    <div class="fix"></div>      
				</div>                  
               
            </fieldset>

        </form>
        
    </div>
            

   <div class="fix"></div>  
   
   <div id="error_msg" class="error_msg" style="clear:both; display: none; cursor:pointer;" onclick="$(this).hide('slow')">
		<div id="msg_text" style="text-align: center" ></div>
</div> 
</div>

<script>

$("#save").click(function (event){
	if ($('#sl_master_directory').attr("value") == "") {
		$('#msg_text').html("Please, select the directory to work in.");
		$('#error_msg').show('fast');		
		return false;
	}
})

</script>